﻿<%--
  Created by IntelliJ IDEA.
  User: hongcy
  Date: 16-3-20
  Time: 下午9:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ include file="/include/taglib.jsp" %>
<div style="padding:20px 0px;">
    <form method="post" action="${ctx}/mulanweb/admin/seller/update" id="ff">
        <input type="hidden" id="sellerId" name="sellerId" value="${param.sellerId}"/>
        <table cellspacing="5" style="margin: 0 auto">
            <tr>
                <td>城市:</td>
                <td><input name="cityId" id="cityId" style="width: 260px;"/></td>
            </tr>
            <tr>
                <td>email:</td>
                <td><input type="text" name="email" id="email" class="easyui-textbox"
                           data-options="required:true" style="width: 260px;"/></td>
            </tr>
            <tr>
                <td>电话:</td>
                <td><input class="easyui-textbox" name="mobile" id="mobile" data-options="required:true,precision:0," style="width: 260px;"/></td>
            </tr>
            <tr>
                <td>详情介绍:</td>
                <td><input type="text" name="description" id="description" class="easyui-textbox"
                           data-options="multiline:true,required:true,validType:{length:[1,200]}"
                           style="width:260px;height:120px"/></td>
            </tr>
            </table>
    </form>
    <div style="width:100%;height:auto;" id="detail-preview"></div>
</div>
<script type="text/javascript">
    $(function () {
        $("#cityId").combobox({
            required: true,
            url: '${ctx}/mulanweb/common/city/search',
            fit: true,
            panelHeight: 200,
            valueField: 'Id',
            textField: 'NameCn',
            editable: false,
            queryParams: {
                PageSize: 100,
                PageNumber: 1
            },
            loadFilter: function (data) {
                var result = [];
                var currentSize = data.PageSize;
                var totalSize = data.TotalRow;
                if (data.ReturnCode == 1 && currentSize >= totalSize) {
                    if (data.DataList.length > 0) {
                        for (var tt = 0; tt < data.DataList.length; tt++) {
                            result.push({Id: data.DataList[tt].Id, NameCn: data.DataList[tt].NameCn});
                        }
                    }
                } else {
                    Constant.showMessage("地点信息已超过最大值");
                }
                return result;
            }
        });

        setTimeout(function(){
            var sellerId = $("#sellerId").val();
            if (sellerId) {
                $.post(Constant.ctx("/mulanweb/admin/seller/getDetail"), {sellerId: sellerId}, function (info) {
                        $("#cityId").combobox("setValue",info.cityId);
                        $("#email").textbox("setValue",info.email);
                        $("#mobile").textbox("setValue",info.mobileNumber);
                        $("#description").textbox("setValue",info.description);
                });
            }
        },1000)

        $("#detail-oldNzdPrice").numberbox({
            onChange:function(newV,oldV){
                $("#detail-oldPrice").numberbox("setValue",newV*5);
            }
        })
    })
</script>
